﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LaunchMeNot.Core;
using LaunchMeNot.DAL;
using LaunchMeNot.Properties;

namespace LaunchMeNot
{
    public class WPFConfiguration : IWPFConfiguration, IDALConfiguration, ICoreConfiguration
    {
        /// <summary>
        /// Number of seconds to wait before commencing AutoLaunch.
        /// </summary>
        public double AutoLaunchDelay { get; set; }
        public bool AutoLaunchAlwaysOnTop { get; set; }
        public bool CloseAfterAutoLaunch { get; set; }
        public bool AllowCancelAutoLaunch { get; set; }

        /// <summary>
        /// Format used on countdown timer for each application on launch form.
        /// </summary>
        public string CountdownFormat { get; set; }

        /// <summary>
        /// Default number of seconds to wait for new LaunchMeNot entries.
        /// </summary>
        public double DefaultLaunchDelay { get; set; }
        public string FilePath { get; set; }

        /// <summary>
        /// <c>true</c> to create/append to a log file each time AutoLaunch is run.
        /// </summary>
        public bool AutoLaunchLog { get; set; }
        public string AutoLaunchLogPath { get; set; }
        
        public WPFConfiguration() {
            AutoLaunchDelay = Settings.Default.AutoLaunchDelay;
            AutoLaunchAlwaysOnTop = Settings.Default.AutoLaunchAOT;
            AllowCancelAutoLaunch = Settings.Default.AllowCancelAutoLaunch;
            CloseAfterAutoLaunch = Settings.Default.CloseAfterAutoLaunch;
            CountdownFormat = Settings.Default.CountdownFormat;
            DefaultLaunchDelay = Settings.Default.DefaultLaunchDelay;
            FilePath = Settings.Default.FilePath;
            AutoLaunchLog = Settings.Default.AutoLaunchLog;
            AutoLaunchLogPath = Settings.Default.AutoLaunchLogPath;
        }
    }
}
